import { Injectable } from '@angular/core';

import { BaseService } from '../base.service';

/*
 *  权限
 * */
export interface Permission {
  hasChildren: boolean;
  menuName: string;
  code: string;
  fatherId: number;
  id: number;
  menuGrade: number; // 级别
  permissionVo: Permission[];
  isOpen?: boolean; // 是否折叠
  checked: boolean;
}

// 更新权限参数接口
export interface PutPermissionParam {
  permissionIds: string[];
  roleId: number;
}

/*
 * 角色
 * */
export interface Role {
  id?: number;
  name: string;
  desc?: string;
}

@Injectable({
  providedIn: 'root'
})
export class RoleService extends BaseService<Role> {
  constructor() {
    super();
    this.apiPrefix = 'adminRole';
  }
}
